Repository navigation
feat(storage): cron and flows on the storage ports - #7187
Conversation
…kend Flow and delegation graph checkpoints now use the configured storage backend through the new tinyflows-drivers dependency, falling back to the existing SQLite files when no backend is set. This keeps checkpoint state in the acting agent's scope instead of local workspace databases. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Regenerate the lockfile to pick up the new tinyflows-drivers crate and the sha2 and tinystoragedrivers-core dependencies it pulls into the app graph. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The tinyflows-drivers dependency now enables its schedule feature by default with default features off, so the cron half is always available like cron itself, while the catalog, flow state and checkpointer features ride the flows gate. The flows feature now activates tinyflows-drivers/catalog instead of the optional dependency. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a block_on variant for futures that already return anyhow::Result, so stores whose errors are anyhow-based (with typed errors callers may downcast) can be driven without wrapping or unwrapping the result. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Every cron store function now checks for a configured storage backend and delegates to CronDocuments in the acting agent's scope, falling back to the SQLite upstream otherwise. This lets cron jobs persist through the document store with the same run-history and task limits. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyflows submodule to a newer revision and refresh Cargo.lock accordingly. The tinyflows-drivers crate now pulls in anyhow, chrono, tinyflows-catalog, tinyflows-schedule, and uuid, and tinyflows-catalog gains anyhow. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Renamed the owned copy of the job id so the original parameter stays available for the confirmation message after the async block. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When a storage backend is configured, flow and draft catalog calls now go through FlowCatalogDocuments in the acting agent's scope instead of the local SQLite directory, falling back to the existing directory-based path otherwise. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The flows directory now always resolves to the workspace path instead of first checking the documents provider, removing a fallible lookup that could not succeed in this context. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Flow state construction now goes through a FlowState helper that opens the flows database or the configured storage backend, replacing direct SqliteStateStore usage in the dedup commit subscriber and capability builder. This centralises backend selection so state access is no longer hard-wired to SQLite. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ites Adds the tinyflows-drivers dev-dependency with test-fixtures so the flows store can forward the document catalog's test fixtures in test builds. The remaining changes are rustfmt reflowing of long call chains and import ordering, with no behaviour change. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a Cargo test target for the new storage flows end-to-end test so it runs as a separate binary, since it installs a storage backend into the process-wide slot and would otherwise interfere with other tests. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Flow state assertions now read and write through the catalog's KV interface instead of the dedup trait, since the engine/dedup sharing is covered by unit tests in core. Also reformats a few assertions to satisfy rustfmt. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add anyhow to tinyflows-catalog and extend tinyflows-drivers with anyhow, chrono, tinyflows-catalog, tinyflows-schedule, and uuid. The lockfile is regenerated to reflect the new dependency graph. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyflows submodule to the latest commit. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyagents submodule to the latest upstream commit. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds README sections describing how cron, flows and the storage layer delegate to the document port when a storage backend is configured, covering the drivers used, scope handling and the block_on_anyhow helper. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Update the vendored submodule pointers for tinymcp, tinysearch and tinyskills to their latest revisions. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewTiny Sweeper completed its review; deterministic results follow. State: Changes requested Review snapshot
Completeness: Complete What changedThis pull request routes the cron store, the flow catalog, flow drafts, per-flow engine state, and both checkpointer call sites (delegation graphs and flow runs) onto the configured storage backend when one is present, falling back to the existing SQLite files otherwise. A new FlowState abstraction in the flows tinyflows module picks Sqlite, document-backed, or an explicitly Unavailable store per call, and a new block_on_anyhow helper bridges the synchronous host APIs to the async document stores. A dedicated end-to-end test binary (storage_flows_e2e) drives cron jobs, the flow catalog, flow state and the KV layer against an in-memory backend and asserts the workspace SQLite files are not written. The cron and flows READMEs document the storage-backed behavior, and the storage README lists the newly ported stores plus the block_on_anyhow helper. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. Findings
Previously reported and still active
Resolved this pass
Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS) Before merge
How this fits togetherflowchart LR
n0["flows_create"]:::impacted
n1["..._expires_stale_runs_but_spares_fresh_ones"]:::impacted
n2["flows_run"]:::impacted
n3["flows_resume"]:::impacted
n4["...t_with_an_incompatible_saved_child_failed"]:::impacted
n5["structurally_valid_graph"]:::impacted
n1 -->|calls| n0
n1 -->|tests| n0
n1 -->|calls| n2
n1 -->|tests| n2
n1 -->|calls| n3
n1 -->|tests| n3
n4 -->|calls| n0
n4 -->|tests| n0
n4 -->|calls| n2
n4 -->|tests| n2
n4 -->|calls| n3
n4 -->|tests| n3
n4 -->|calls| n5
n4 -->|tests| n5
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
e2e
Evidence and run details
|
There was a problem hiding this comment.
Requesting changes: 2 lane(s) blocking, worst finding is critical.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.0084 · 702,330 in / 38,462 out · 64,440 cached (9%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0042 · 333,856 in / 18,854 out · 35,619 cached (11%) · gpt-5.6-luna, glm-5.3-flash
security: $0.0028 · 225,206 in / 11,206 out · 26,965 cached (12%) · gpt-5.6-luna
tests: $0.0004 · 46,378 in / 3,574 out · 1,856 cached (4%) · glm-5.3-flash
description: $0.0002 · 22,634 in / 172 out · 0 cached (0%) · glm-5.3-flash
e2e: $0.0005 · 51,757 in / 697 out · 0 cached (0%) · glm-5.3-flash
Update the vendored tinymcp and tinysearch submodule pointers to their latest revisions. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…eam main The previous auto-commit recorded stale local submodule checkouts. Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 654eaf5307
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Requesting changes: 2 lane(s) blocking, worst finding is critical.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.0088 · 696,362 in / 52,270 out · 111,555 cached (16%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0046 · 344,787 in / 30,333 out · 62,993 cached (18%) · gpt-5.6-luna, glm-5.3-flash
security: $0.0033 · 257,564 in / 17,489 out · 46,706 cached (18%) · gpt-5.6-luna
tests: $0.0002 · 21,935 in / 811 out · 0 cached (0%) · glm-5.3-flash
description: $0.0002 · 23,128 in / 951 out · 0 cached (0%) · glm-5.3-flash
e2e: $0.0002 · 25,722 in / 1,150 out · 1,728 cached (7%) · glm-5.3-flash
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
Requesting changes: 2 lane(s) blocking, worst finding is critical.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.0373 · 791,175 in / 60,211 out · 103,799 cached (13%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0204 · 412,248 in / 29,418 out · 56,253 cached (14%) · gpt-5.6-luna, glm-5.3-flash
security: $0.0156 · 259,647 in / 25,886 out · 34,106 cached (13%) · gpt-5.6-luna
tests: $0.0004 · 47,046 in / 802 out · 13,440 cached (29%) · glm-5.3-flash
description: $0.0002 · 23,232 in / 762 out · 0 cached (0%) · glm-5.3-flash
e2e: $0.0002 · 25,789 in / 548 out · 0 cached (0%) · glm-5.3-flash
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f40fb22c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
The previously-blocking findings are resolved. Clearing the changes request.
$0.0043 · 202,370 in / 15,234 out · 9,982 cached (5%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0008 · 54,433 in / 5,311 out · 7,934 cached (15%) · gpt-5.6-luna
security: $0.0024 · 27,087 in / 2,330 out · 0 cached (0%) · gpt-5.6-luna
tests: $0.0002 · 22,356 in / 1,234 out · 64 cached (0%) · glm-5.3-flash
description: $0.0002 · 23,460 in / 1,509 out · 64 cached (0%) · glm-5.3-flash
e2e: $0.0005 · 52,290 in / 2,905 out · 1,792 cached (3%) · glm-5.3-flash
There was a problem hiding this comment.
Requesting changes: 2 lane(s) blocking, worst finding is critical.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.0036 · 185,827 in / 12,795 out · 26,050 cached (14%) · gpt-5.6-luna, glm-5.3-flash
critique: $0.0009 · 42,231 in / 4,142 out · 14,319 cached (34%) · gpt-5.6-luna, glm-5.3-flash
security: $0.0016 · 22,362 in / 1,713 out · 6,995 cached (31%) · gpt-5.6-luna
tests: $0.0004 · 48,943 in / 1,819 out · 1,600 cached (3%) · glm-5.3-flash
description: $0.0002 · 23,460 in / 852 out · 1,408 cached (6%) · glm-5.3-flash
e2e: $0.0002 · 26,072 in / 1,152 out · 1,728 cached (7%) · glm-5.3-flash
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7df8d512b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
OPENHUMAN_STORAGE_URL/[storage] url, feat(storage): storage backend by URL; session stores on tinystoragedrivers; bump tinyagents + tinyflows #7168), these move off their SQLite files into the backend's document store, in the acting agent's scope:cron/jobs.db)flows/flows.db)flows/drafts/)flows/checkpoints.db)graph_checkpoints.db)CronDocuments)FlowCatalogDocuments,FlowStateDocuments)DriverCheckpointerin both tinyflows-drivers and tinyagents-graphtinyflows-driversis pulled with only itsschedulefeature unconditionally; the catalog, flow state and checkpointer ride theflowsgate (tinyflows-drivers/catalog).cargo tree -p openhuman --no-default-featurescontains notinyflowsengine.vendor/tinyflowstomain(fe508cad, includes feat(web-search): add Parallel search provider to WebSearchTool #114 and Feat/memory agent #115).Problem
Solution
cron/store.rs: each function asksdocuments(config)?first and, when a backend is installed, runs the matchingCronDocumentsmethod throughstorage::block_on_anyhow, with the samemax_run_history/max_taskslimits.flows/store.rs/draft_store.rs: the same dispatch overFlowCatalogDocuments.update_flow_graphkeeps returningFlowUpdateError, and storage failures map toFlowUpdateError::Store.flows/tinyflows/state.rs(new):FlowStateis one type for a flow'sflow:<id>namespace, eitherSqliteStateStoreorFlowStateDocuments. It implements both the engine'sStateStoreandDedupKv, so what a run stores is exactly whatbus::dedup_commitsettles. When the scope can't be resolved (SaaS with no acting agent) every call fails instead of falling back to the file.build_capabilitiesanddedup_commituse it.open_flow_checkpointerand the delegation graph pickDriverCheckpointerover the scoped documents when a backend is installed. The delegation checkpointer uses thedelegation_graphprefix.storage::block_on_anyhow:block_onfor stores whose errors areanyhow::Error, so downcastable typed errors pass through.Submission Checklist
flows/tinyflows/state_tests.rs: engine and dedup views share records on both stores; namespaces isolated; an unresolved scope fails every call; no backend means SQLite.tests/storage_flows_e2e.rs(own binary, memory backend):flows_create/flows_listthrough the RPC ops;kv_get/kv_set;cron/jobs.dborflows/flows.dbwritten, and SQLite back in use afterstorage::clear().memorydriver.Impact
tinyflows-drivers(unpublished, in the vendored tinyflows) joins core:schedulealways,catalogwithflows. tinyagents-graph gains itsstorage-driversfeature. The app lockfile is updated.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
storage-cron-flowsValidation Run
pnpm --filter openhuman-app format:check: N/A, no frontend changespnpm typecheck: N/A, no frontend changesRUST_MIN_STACK=16777216 cargo test -p openhuman --lib -- flows:: cron:: storage:: agent::orchestration security::devices desktop::notifications integrations::task_sources(1404 passed)cargo test -p openhuman-cli --test storage_flows_e2e --test storage_domains_e2ecargo fmt,cargo clippy -p openhuman --lib --tests -- -D warnings,pnpm rust:layout,cargo check -p openhuman --no-default-features,node scripts/ci/check-feature-forwarding.mjsValidation Blocked
command:node scripts/ci/check-saas-ambient.mjserror:"Fixed sites still in the baseline (1)": a stale entry from feat(storage): devices, notifications and task sources on the storage ports #7181, fixed by chore(ci): drop the saas-ambient baseline entry #7181 fixed #7186impact:thesaas-ambientlane stays red until chore(ci): drop the saas-ambient baseline entry #7181 fixed #7186 mergesBehavior Changes
Parity Contract
documents(config)?check per function, and flow state fails closed when the scope does not resolve.Duplicate / Superseded PR Handling
Summary by CodeRabbit